<?php
header('Content-type:text/html;charset=utf-8');

//包含数据库配置
include '../../public/peizhi.php';

//包含函数
include '../../public/func.php';

//调用函数
$link = db();

//接值判断
if(!empty($_REQUEST['tz_id'])){
	$tz_id = $_REQUEST['tz_id'];
		if(is_array($tz_id)){
			$newid = implode(',',$tz_id);
			$sql = "delete from fatie where id in({$newid})";
		}else{
			$newid = $tz_id;
			$sql = "delete from fatie where id in({$newid})";
		}
}else{
	exit('<script>alert("没有帖子或没有选择帖子");window.location.href="show.php";</script>');
}

//判断执行SQL语句
if($res = mysqli_query($link,$sql)){
	echo '<script>alert("删除帖子成功");window.location.href="show.php";</script>';
}else{
	echo '<script>alert("删除帖子失败");window.location.href="show.php";</script>';
}

//关闭数据库连接
mysqli_close($link);


